﻿<?php
// ------------------------------------------------------------------
// NEEDED STUBS FOR THIS EXAMPLE
// ------------------------------------------------------------------


// this will include all needed files to be able to build a Request
include_once($CONF["STUBS_FOLDER"]."Map24MapletRemoteControl/Map24MapletRemoteControl.php5");


// ------------------------------------------------------------------
// NEEDED PARAMETERS FOR THIS REQUEST
// ------------------------------------------------------------------


//Flightproperties
$proIdx=0;
$property[$proIdx]=new Property();
$property[$proIdx]->Key		= "Control";
$property[$proIdx]->Value 	= "Start";


// ------------------------------------------------------------------
// BUILDING THE REQUEST
// ------------------------------------------------------------------


// here are all commands defined and are put together in one ArrayOfCommands

// this object will enable the controll object
$cmdIdx=0;
$commands[$cmdIdx] = new XMLCommandWrapper();
$commands[$cmdIdx]->ControlComponent = new ControlComponent();
$commands[$cmdIdx]->ControlComponent->Component= "SHOWM3DROUTE";//SHOWM3D, SHOWTBAR, SHOWOV, SHOWM3DROUTE, PAINTTOOLBOX
$commands[$cmdIdx]->ControlComponent->Control= "SHOW";			//SHOW or HIDE

//this will slide it in or out
$cmdIdx++;
$commands[$cmdIdx] = new XMLCommandWrapper();
$commands[$cmdIdx]->ControlComponent = new ControlComponent();
$commands[$cmdIdx]->ControlComponent->Component= "M3DROUTE";	//M3D, TBAR, OV, M3DROUTE,
$commands[$cmdIdx]->ControlComponent->Control= "SHOW";			//SHOW or HIDE
$commands[$cmdIdx]->ControlComponent->Properties=$property;		//Properties

// definition of the request header with Map24ID and SessionID
$header = new RequestHeader();
$header->Map24ID  = $CONF['MAP24_ID'];
$header->ClientID = $CONF['SESSION_ID'];

// definition of the request body
$request = new MapletRemoteControlRequest();
$request->Map24MRC = new Map24MRC();
$request->Map24MRC->Commands = $commands;


// ------------------------------------------------------------------
// EXECUTE THE REQUEST
// ------------------------------------------------------------------


// in this object the SoapClient will be initiated and executed
$mrc = new Map24MapletRemoteControl($CONF['MAPTP_SYSTEM'],$CONF['MAP24_ID'],$CONF['SESSION_ID']);
$response = $mrc->mapletRemoteControl($header,$request);


// ------------------------------------------------------------------
// OUTPUT THE RESULT
// ------------------------------------------------------------------


$resultString = "This command generates no output";
$counter = 0;

?>